<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Dcat\Admin\Traits\ModelTree;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;

class PetProductCate extends Model
{
    use HasDateTimeFormatter;
    use SoftDeletes;
    use ModelTree;
    protected $table = 'pet_product_cate';
    // 定义一个public方法访问图片或文件
//    public function getImage()
//    {
//        if (Str::contains($this->image, '//')) {
//            return $this->image;
//        }
//
//        return Storage::disk('admin')->url($this->image);
//    }

}
